<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
    
     <div class="container-div">
		<div class="row">
			<div class="col-sm-12 search-collapse">
				<form id="formId">
					<div class="select-list">
						<ul>
							<li>
								电梯名称：<input type="text" name="elevatorName"/>
							</li>

							<li>
								年检日期：<input type="text" name="annualDate"/>
							</li>
							<li>
								年检状态：
								<select name="inspectionStatus">
									<option value="">全部</option>
									<option value="0">待启动</option>
									<option value="1">执行中</option>
									<option value="2">已完成</option>
									<option value="3">已超期</option>
								</select>
							</li>

							<li>
								年检负责人：<input type="text" name="headMan"/>
							</li>

							<li>
								年检启动日期：<input type="text" name="startTime"/>
							</li>

							<li>
								年检完成时间：<input type="text" name="completionTime"/>
							</li>

							<li class="select-time">
								<label>创建时间： </label>
								<input type="text" class="time-input" id="startTime" placeholder="开始" name="params[beginTime]"/>
								<span>-</span>
								<input type="text" class="time-input" id="endTime" placeholder="结束" name="params[endTime]"/>
							</li>
							<li>
								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
								<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
							</li>
						</ul>
					</div>
				</form>
			</div>
			
	        <div class="btn-group-sm hidden-xs" id="toolbar" role="group">
				<a class="btn btn-success" onclick="$.operate.addWin(400,500)" shiro:hasPermission="business:annualInspection:add">
					<i class="fa fa-plus"></i> 手动分配
				</a>
				<a class="btn btn-danger btn-del btn-del disabled" onclick="$.operate.removeAll()" shiro:hasPermission="business:annualInspection:remove">
					<i class="fa fa-remove"></i> 删除
				</a>
				<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="business:annualInspection:export">
						<i class="fa fa-download"></i> 导出
				 </a>
			</div>
			<div class="col-sm-12 select-table table-striped">
				<table id="bootstrap-table" data-mobile-responsive="true"></table>
			</div>
		</div>
	</div>
    <div th:include="include :: footer"></div>
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('business:annualInspection:edit')}]];
        var removeFlag = [[${@permission.hasPermi('business:annualInspection:remove')}]];
        var prefix = ctx + "business/annualInspection";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
				exportUrl: prefix + "/export",
                modalName: "电梯年检管理",
				search: false,
		        showExport: true,
                columns: [{
		            checkbox: true
		        },
				{
					field : 'inspectionId', 
					title : '年检ID',
					visible: false
				},
				{
					title: "序号",
					formatter: function (value, row, index) {
						return $.table.serialNumber(index);
					}
				},
				{
					field : 'elevatorName', 
					title : '电梯名称'
				},
				{
					field : 'annualDate', 
					title : '年检日期',
					sortable: true
				},
				{
					field : 'checkSpeedLimiter', 
					title : '是否检查限速器',
                    formatter : function(value){
					    return value == 0 ? "是" : "否";
					}
				},
				{
					field : 'checkThrough', 
					title : '是否年检通过',
                    formatter : function(value){
                        return value == 0 ? "是" : "否";
                    }
				},
				{
					field : 'inspectionStatus', 
					title : '年检状态',
                    formatter : function(value){
                        return value == 0 ? "待启动" : value == 1 ? "执行中" : value == 2 ? "已完成" : value == 3 ? "已超期" : "未定义";
                    }
				},
				{
					field : 'headMan', 
					title : '年检负责人'
				},
				{
					field : 'startTime', 
					title : '年检启动日期',
					sortable: true
				}]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>